EEL_MODS	+= optee_client

$(eval $(call deftargets_git,optee_client,OTCL))
$(eval $(call deftargets_download,optee_client,OTCL,$$(OPTEE_VERSION),$$(OPTEE_VERSION)))

PHONY-optee_client += otcl-%
otcl-%: $(BUILD_DEPS) optee_client-prepare
	$(EELQ3)$(MAKE) $(JOB_OPT) \
		-C $(S_OTCL_DIR) \
		CROSS_COMPILE=$(TC_PREFIX) \
		O=$(O_OTCL_DIR) \
		$(patsubst otcl-%,%,$@)

# FIXME: libteeacl of optee_client >=3.19 need uuid, use fake uuid now
# enable BR2_PACKAGE_UTIL_LINUX_UUIDD at buildroot
PHONY-optee_client += optee_client optee_client-clean
optee_client: $(BUILD_DEPS) optee_client-prepare
	$(EELQ5)\rm -f $(O_OTCL_DIR)/.build_done.optee_client
	$(EELQ)$(MAKE_THIS) otcl-all PKG_CONFIG=pkg-config || true
	$(EELQ)$(MAKE_THIS) otcl-all PKG_CONFIG=true
	$(EELQ3)touch $(O_OTCL_DIR)/.build_done.optee_client

optee_client-clean: otcl-clean

# for $(O_OTCL_DIR)/export
$(O_OTCL_DIR)/export: $(O_OTCL_DIR)/.build_done.optee_client
$(O_OTCL_DIR)/.build_done.optee_client:
	$(EELQ4)$(MAKE_THIS) optee_client

